import Layout from '../components/Layout'
import Movie, {loadMovie} from '../components/Movie'
import Swipper, {loadSwiper} from '../components/swipper'


export default function Home({swiper, movie}) {
  // console.log(swiper)
  // console.log(movie)
  return (
    <div>
      <Layout></Layout>
      <Swipper data={swiper}></Swipper>
      <Movie data={movie} title='电影'></Movie>
    </div>
  )
}
export async function getStaticProps () {
  // 获取轮播图数据
  let { data: swiper } = await loadSwiper()
  // 获取电影列表数据
  let {data: movie} = await loadMovie()
  // console.log(swiper)
  // console.log(movie)
  return {
    props: {
      swiper,
      movie
    }
  }
}
